package net.itheima.mm.service.impl;

import net.itheima.mm.dao.TagDao;
import net.itheima.mm.entity.QueryPageBean;
import net.itheima.mm.pojo.Tag;
import net.itheima.mm.service.TagService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author zhangyan
 * @date 2021/2/27 21:24
 */
@Service
public class TagServiceImpl implements TagService {

    @Autowired
    TagDao tagDao;

    @Override
    public long getTotal() {
        System.out.println("查询总条数:" + tagDao.getTotal());
        return tagDao.getTotal();
    }

    @Override
    public List<Tag> findListByPage(QueryPageBean queryPageBean) {
        return tagDao.findListByPage(queryPageBean);
    }

    @Override
    public void add(Tag tag) {
        tagDao.add(tag);
    }

    @Override
    public void update(Tag tag) {
        tagDao.update(tag);
    }

    @Override
    public void delete(Integer id) {
        tagDao.delete(id);
    }
}
